package org.smarthings.things.management.rest;

import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

import org.smarthings.things.management.rest.resources.ThingEventSubscriptionResource;

@Path("things")
public interface RemoteEventsSubscriptionsManagement {

	@POST
	@Path("subscriptions")
	Response subscribeThingRegisteredUnregistered(ThingEventSubscriptionResource subscription)
			throws WebApplicationException;

	@DELETE
	@Path("subscriptions/{subscriptionUUID}")
	Response unsubscribeThingRegisteredUnregistered(
			@PathParam("subscriptionUUID") String subscriptionUUID) throws WebApplicationException;

	@POST
	@Path("{thingUUID}/subscriptions")
	Response subscribeThingChanged(@PathParam("thingUUID") String thingUUID,
			ThingEventSubscriptionResource subscription) throws WebApplicationException;

	@DELETE
	@Path("{thingUUID}/subscriptions/{subscriptionUUID}")
	Response unsubscribeThingChanged(@PathParam("thingUUID") String thingUUID,
			@PathParam("subscriptionUUID") String subscriptionUUID) throws WebApplicationException;

	@POST
	@Path("{thingUUID}/properties/{propertyUUID}/subscriptions")
	Response sunscribeThingPropertyChanged(@PathParam("thingUUID") String thingUUID,
			@PathParam("propertyUUID") String propertyUUID,
			ThingEventSubscriptionResource sunscription) throws WebApplicationException;

	@DELETE
	@Path("{thingUUID}/properties/{propertyUUID}/subscriptions/{subscriptionUUID}")
	Response unsunscribeThingPropertyChanged(@PathParam("thingUUID") String thingUUID,
			@PathParam("propertyUUID") String propertyUUID,
			@PathParam("subscriptionUUID") String subscriptionUUID) throws WebApplicationException;
}
